// import Cookies from 'js-cookie'
// import { m as zh } from '@/lang/zh.js';
// import { m as en } from '@/lang/en.js';
// console.log(en)
// import es from '@/lang/es.js';
// import ja from '@/lang/ja.js';
// console.log(zh.route);
const state = {
    // route: zh.route,
    // token: localStorage.getItem('x-auth-token') ? localStorage.getItem('x-auth-token') : '',
    tblTags: {},
    // 标签页
    // tagsList: localStorage.getItem('tagsList') || [],
    tagsList: [],
    // 专辑信息数
    albumInfoData: [

    ],
    //  歌手管理下和专辑管理下的歌曲信息
    songInfoData: {},
    // 歌曲管理下的歌曲信息
    songInfoData_: {
        albumPicture: {},
        tblActors: [{ name: '' }],
        tblAlbumPictures: [{
            filePath: ''
        }]
    },
    singerinfo: {},
    // 专辑管理下歌手信息
    // singerinfo_: { tblActors: [] },
    singerinfo_: {},
    songalbumids: {},

    // ============================编辑歌单==================================
    playing_l: false,
    playing_r: false,
    playList_l: [

    ],
    playList_r: [{
            id: 1,
            // url: require("@/assets/mp3/演员.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
        {
            id: 2,
            // url: require("@/assets/mp3/绅士.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
    ],
    currentIndex_l: -1,
    currentIndex_r: -1,
    // ====================编辑电台======================
    currentRadioStationIndex_l: -1,
    currentRadioStationIndex_r: -1,
    radioStationPlayList_l: [

    ],
    radioStationPlayList_r: [{
            id: 1,
            // url: require("@/assets/mp3/演员.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
        {
            id: 2,
            // url: require("@/assets/mp3/绅士.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
    ],
    radioStationPlaying_l: false,
    radioStationPlaying_r: false,
    // ====================编辑榜单======================
    currentRankingIndex_l: -1,
    currentRankingIndex_r: -1,
    rankingPlayList_l: [

    ],
    rankingPlayList_r: [{
            id: 1,
            // url: require("@/assets/mp3/演员.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
        {
            id: 2,
            // url: require("@/assets/mp3/绅士.mp3"),
            url: 'http://static.xingfeng.cool/mp3/%E7%BB%85%E5%A3%AB.mp3'
        },
    ],
    rankingPlaying_l: false,
    rankingPlaying_r: false,
}

const mutations = {
    // DEL_TOKEN: (state) => {
    //     state.token = '';
    //     localStorage.removeItem("x-auth-token");
    // },

    // SET_LANGUAGE: (state, language) => {
    //     if (language == 'zh') {
    //         state.route = zh.route
    //     } else if (language == 'en') {
    //         state.route = en.route
    //     } else if (language == 'es') {
    //         state.route = es.route
    //     } else if (language == 'ja') {
    //         state.route = ja.route

    //     }
    //     Cookies.set('language', language)
    // },
    SET_TBLTAGS: (state, tblTags) => {
        state.tblTags = tblTags
    },
    SET_ALBUMINFODATA: (state, albumInfoData) => {
        state.albumInfoData = albumInfoData
    },
    // ====================专辑管理======================
    SET_SONGINFODATA: (state, songInfoData) => {
        state.songInfoData = songInfoData
    },
    SET_SONGINFODATA_: (state, songInfoData_) => {
        state.songInfoData_ = songInfoData_
    },
    SET_SINGERINFO: (state, singerinfo) => {
        state.singerinfo = singerinfo
    },
    SET_SINGERINFO_: (state, singerinfo_) => {
        state.singerinfo_ = singerinfo_
    },
    SET_SONGALBUMIDS: (state, songalbumids) => {
        state.songalbumids = songalbumids
    },
    SET_TAGSLIST: (state, tagsList) => {
        state.tagsList = tagsList
    },
    // ====================编辑歌单======================
    SET_CURRENT_INDEX_R: (state, currentIndex_r) => {
        state.currentIndex_r = currentIndex_r
    },
    SET_CURRENT_INDEX_L: (state, currentIndex_l) => {
        state.currentIndex_l = currentIndex_l
    },
    SET_PLAYLIST_L: (state, playList_l) => {
        state.playList_l = playList_l
    },
    SET_PLAYLIST_R: (state, playList_r) => {
        state.playList_r = playList_r
    },
    SET_PLAYING_STATE_L: (state, playing_l) => {
        state.playing_l = playing_l
    },
    SET_PLAYING_STATE_R: (state, playing_r) => {
        state.playing_r = playing_r
    },

    // ====================编辑电台======================

    SET_RADIO_STATION_CURRENT_INDEX_R: (state, currentRadioStationIndex_r) => {
        state.currentRadioStationIndex_r = currentRadioStationIndex_r
    },
    SET_RADIO_STATION_CURRENT_INDEX_L: (state, currentRadioStationIndex_l) => {
        state.currentRadioStationIndex_l = currentRadioStationIndex_l
    },
    SET_RADIO_STATION_CURRENT_PLAYLIST_L: (state, radioStationPlayList_l) => {
        state.radioStationPlayList_l = radioStationPlayList_l
    },
    SET_RADIO_STATION_CURRENT_PLAYLIST_R: (state, radioStationPlayList_r) => {
        state.radioStationPlayList_r = radioStationPlayList_r
    },
    SET_RADIO_STATION_CURRENT_PLAYING_STATE_L: (state, radioStationPlaying_l) => {
        state.radioStationPlaying_l = radioStationPlaying_l
    },
    SET_RADIO_STATION_CURRENT_PLAYING_STATE_R: (state, radioStationPlaying_r) => {
        state.radioStationPlaying_r = radioStationPlaying_r
    },
    // ====================编辑榜单======================
    SET_EDIT_RANKING_CURRENT_INDEX_R: (state, currentRankingIndex_r) => {
        state.currentRankingIndex_r = currentRankingIndex_r
    },
    SET_EDIT_RANKING_CURRENT_INDEX_L: (state, currentRankingIndex_l) => {
        state.currentRankingIndex_l = currentRankingIndex_l
    },
    SET_EDIT_RANKING_CURRENT_PLAYLIST_L: (state, rankingPlayList_l) => {
        state.rankingPlayList_l = rankingPlayList_l
    },
    SET_EDIT_RANKING_CURRENT_PLAYLIST_R: (state, rankingPlayList_r) => {
        state.rankingPlayList_r = rankingPlayList_r
    },
    SET_EDIT_RANKING_CURRENT_PLAYING_STATE_L: (state, rankingPlaying_l) => {
        state.rankingPlaying_l = rankingPlaying_l
    },
    SET_EDIT_RANKING_CURRENT_PLAYING_STATE_R: (state, rankingPlaying_r) => {
        state.rankingPlaying_r = rankingPlaying_r
    },
}

const actions = {
    // setLanguage({ commit }, language) {
    //     commit('SET_LANGUAGE', language)
    // },
    setAlbumInfoData({ commit }, albumInfoData) {
        commit('SET_ALBUMINFODATA', albumInfoData)
    },
    // 歌手管理下和专辑管理下的歌曲信息
    setSongInfoData({ commit }, songInfoData) {
        commit('SET_SONGINFODATA', songInfoData)
    },
    // 歌曲管理下的歌曲信息
    setSongInfoData_({ commit }, songInfoData_) {
        commit('SET_SONGINFODATA_', songInfoData_)
    }
}

export default {
    state,
    mutations,
    actions
}